﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Pixysoft.Framework.Noebe
{
    public interface IPagingCommand : IDisposable
    {
        /// <summary>
        /// 分页表名
        /// </summary>
        string TableName { get; set; }

        /// <summary>
        /// 分页字段名
        /// </summary>
        string ColumnName { get; set; }

        /// <summary>
        /// 页大小
        /// </summary>
        int PageCapacity { get; set; }

        /// <summary>
        /// 当前页数
        /// </summary>
        int PageIndex { get; set; }

        /// <summary>
        /// 是否反序 最新的开始
        /// </summary>
        bool Reverse { get;set;}

        /// <summary>
        /// 查询约束（不包含orderby/groupby）
        /// </summary>
        string Condition { get; set; }

        /// <summary>
        /// 参数
        /// </summary>
        NoebeParameterCollection Parameters { get;}

        /// <summary>
        /// 获取分页的sql
        /// </summary>
        /// <returns></returns>
        string GetSQL();

        /// <summary>
        /// 执行查询结果
        /// </summary>
        /// <returns></returns>
        DataTable ExecuteReader();
    }
}
